package com.aspose.cells.a.d;

import java.util.Iterator;

public class zgl extends ze {
   private com.aspose.cells.b.a.b.zo f;
   private StringBuilder g;
   private boolean h;
   private com.aspose.cells.b.a.b.a.zi i = null;
   private boolean j = false;
   private boolean k = false;

   public zgl() {
   }

   public zgl(boolean var1) {
      this.k = var1;
   }

   public boolean c() {
      return this.k;
   }

   public String a(zn var1, boolean var2) throws Exception {
      this.g = new StringBuilder();
      this.j = var2;
      this.i = var1.a();
      var1.a((ze)this);
      return com.aspose.cells.b.a.zr.a(this.g);
   }

   public void a(zo var1) {
      this.a(var1.a());
      this.f = var1.a();
      this.h = true;
   }

   public void b(zo var1) {
      if (var1.b()) {
         this.g.append("Z ");
      }

   }

   public void a(za var1) {
      zt[] var2 = var1.c();
      zt var3 = var2[0];
      if (var2.length > 0) {
         if (this.h) {
            this.a(var3.a());
            this.h = false;
         } else {
            this.b(var3.a());
         }

         com.aspose.cells.b.a.b.zo[] var4 = new com.aspose.cells.b.a.b.zo[3];

         for(int var5 = 0; var5 < var2.length; ++var5) {
            var3 = var2[var5];
            var4[0] = var3.b();
            var4[1] = var3.c();
            var4[2] = var3.d();
            this.a(var4);
            this.f = var3.d();
         }

      }
   }

   public void a(zq var1) {
      if (var1.a().size() > 0) {
         if (this.h) {
            this.h = false;
         }

         for(int var2 = 0; var2 < var1.a().size(); ++var2) {
            com.aspose.cells.b.a.b.zo var3 = (com.aspose.cells.b.a.b.zo)var1.a().get(var2);
            if (var3.d() != this.f.d() || var3.e() != this.f.e()) {
               this.b(var3);
               this.f = var3;
            }
         }

      }
   }

   public void a(zp var1) {
      zt var2 = (zt)var1.a().get(0);
      if (this.h) {
         this.h = false;
      } else {
         this.b(var2.a());
      }

      zt var4;
      for(Iterator var3 = var1.a().iterator(); var3.hasNext(); this.f = var4.d()) {
         var4 = (zt)var3.next();
         com.aspose.cells.b.a.b.zo[] var5 = new com.aspose.cells.b.a.b.zo[]{var4.b(), var4.c(), var4.d()};
         this.a(var5);
      }

   }

   private void a(com.aspose.cells.b.a.b.zo var1) {
      if (this.i != null && this.j) {
         com.aspose.cells.b.a.b.zo[] var2 = new com.aspose.cells.b.a.b.zo[]{new com.aspose.cells.b.a.b.zo(var1.d(), var1.e())};
         this.i.a(var2);
         com.aspose.cells.b.a.g.zf.a(this.g, "M{0} ", zgf.a(var2[0]));
      } else {
         com.aspose.cells.b.a.g.zf.a(this.g, "M{0} ", zgf.a(var1));
      }

   }

   private void b(com.aspose.cells.b.a.b.zo var1) {
      if (this.i != null && this.j) {
         com.aspose.cells.b.a.b.zo[] var2 = new com.aspose.cells.b.a.b.zo[]{new com.aspose.cells.b.a.b.zo(var1.d(), var1.e())};
         this.i.a(var2);
         com.aspose.cells.b.a.g.zf.a(this.g, "L{0} ", zgf.a(var2[0]));
      } else {
         com.aspose.cells.b.a.g.zf.a(this.g, "L{0} ", zgf.a(var1));
      }

   }

   private void a(com.aspose.cells.b.a.b.zo[] var1) {
      this.g.append("C");
      if (this.i != null && this.j) {
         com.aspose.cells.b.a.b.zo[] var4 = new com.aspose.cells.b.a.b.zo[var1.length];

         int var3;
         for(var3 = 0; var3 < var4.length; ++var3) {
            var4[var3] = new com.aspose.cells.b.a.b.zo(var1[var3].d(), var1[var3].e());
         }

         this.i.a(var4);

         for(var3 = 0; var3 < var1.length; ++var3) {
            this.g.append(zgf.a(var4[var3]));
            this.g.append(" ");
         }
      } else {
         for(int var2 = 0; var2 < var1.length; ++var2) {
            this.g.append(zgf.a(var1[var2]));
            this.g.append(" ");
         }
      }

   }
}
